package com.guaoran.interview.before.designPatterns;

/**
 * @author : guCheng
 * @title : Singleton 
 * @Description : 
 * 	 用过哪些设计模式，手写一个（除单例）；
 * @date :2018年3月10日下午8:10:06
 */
public class Singleton {
	public static void main(String[] args) {
		
		
		SourceAble design = new ProxyDesign();
		design.method();
	}
}

interface SourceAble{
	public void method();
}
class ProxySourceDesign implements SourceAble{
	@Override
	public void method() {
		System.out.println("..ProxySourceDesign..");
	}
	
}
class ProxyDesign implements SourceAble{
	private ProxySourceDesign design;
	public ProxyDesign (){
		super();
		design = new ProxySourceDesign();
	}
	@Override
	public void method() {
		after();
		design.method();
		before();
		
	}
	public void after(){
		System.out.println("after");
	}
	public void before(){
		System.out.println("before");
	}
	
}